<h2>创建/编辑链接统计</h2>
<div class="col-md-12">
  <div class="panel panel-default">
    <div class="panel-heading clearfix">
      创建/编辑链接统计
      <a class="btn btn-sm btn-success taskaddBtn" href="/manage/stat/link/"> <i
            class="glyphicon glyphicon-arrow-left"></i> 返回链接统计列表</a>
    </div>
    <div class="panel-body">
      <?php if(!empty($message)):?>
        <div class="alert alert-dismissible alert-danger">
          <button type="button" class="close" data-dismiss="alert">&times;</button>
            <?php echo htmlspecialchars($message)?>
        </div>
      <?php endif;?>
        <form action="/admin/stat/addlink" method="post" onsubmit="return checkPara();">
          <?php if(!empty($stat_info)):?>
              <input type="hidden" class="form-control" name="id" value="<?php echo $stat_info['id']?>" />
          <?php endif;?>
          <div class="form-group">
            <label class="control-label">链接统计标题</label>
            <input class="form-control" name="title" id="title" type="text" placeholder="链接统计标题" value="<?php if(!empty($stat_info)):?><?php echo $stat_info['title']?><?php endif;?>">
          </div>
          <div class="form-group">
            <label class="control-label">跳转链接</label>
            <input class="form-control" name="third_url" id="third_url" type="text" placeholder="链接统计标题" value="<?php if(!empty($stat_info)):?><?php echo $stat_info['third_url']?><?php endif;?>">
            <small>跳转到网址，如 https://itunes.apple.com/cn/app/id1090285095?mt=8, 需要完整的带http的URL</small>
          </div>
          <button type="submit" class="btn btn-default" >提交</button>
        </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    function checkPara() {
        var title = $("#title").val();
        if (title == '') {
            alert("请填入链接统计标题");
            return false;
        }
        var third_url = $("#third_url").val();
        if (appstore_id == '') {
            alert("请填入跳转链接");
            return false;
        }
    }
</script>